package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.R;
import com.zzyl.nursing.dto.LoginVo;
import com.zzyl.nursing.dto.UserLoginRequestDto;
import com.zzyl.nursing.service.IFamilyMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "小程序登录管理")
@RestController
@RequestMapping("/member/user")
public class LoginController {

    @Autowired
    private IFamilyMemberService familyMemberService;

    @ApiOperation("小程序登录")
    @PostMapping("/login")
    public R<LoginVo> login(@RequestBody UserLoginRequestDto loginRequestDto) {
        LoginVo loginVo = familyMemberService.login(loginRequestDto);
        return R.ok(loginVo);
    }
}
